interface PerSon{
    name:string;
    age:number;
}
interface TeaCher{
    id:number;
    name:string;
    age:number;
    sex:string;
}

type TeaCherInfo=PerSon&TeaCher;
let teaCherInfo:TeaCherInfo={name:'Jack',age:18,id:1,sex:'male'};
console.log(teaCherInfo);
interface StuDent{
    id:number; 
}
//交叉类型，PersonInfo类型是Person类型和Student类型的交集，
// PersonInfo类型的实例必须同时拥有Person类型和Student类型的属性
type PerSonInfo=PerSon&StuDent;
let perSonInfo:PerSonInfo={name:'Jack',age:18,id:1};
console.log(perSonInfo);
//type TEACHER = number | string;
// function getTeaCher(TEACHER:TEACHER):TEACHER{
//     return TEACHER
// }
// console.log(getTeaCher(1));//1
// console.log(getTeaCher('1234567'));//'1234567'
